package application.snakes;

import java.util.Timer;

import application.GameManager;
import application.GameMatrix;
import application.auxclasses.FuzzyWaitTask;
import application.food.IceCream;
import application.food.Insect;
import application.food.Meat;

public class Predator extends Snake {
	
	public Predator(GameMatrix matrix, GameManager gameManager) {
		super(matrix,gameManager);
		GameManager.print("made a predator");
	}
	public void visit(Meat meat) {
		GameManager.print("predator ate meat");
		super.move();
		super.repaint();
		super.move();
		super.repaint();
		super.updateScore(20);
	}
	public void visit(IceCream icecream) {
		if(!super.is_isFuzzy()){
			GameManager.print("predator ate ice cream");
			Timer timer = new Timer();
			super.changeFuzzy();
			GameManager.print("Now fuzzy");
			FuzzyWaitTask fwt = new FuzzyWaitTask(super.getInstance());
			timer.schedule(fwt, 30000);
		}
	}
	public void visit(Insect insect) {
		GameManager.print("predator ate insect");
		super.move();
		super.repaint();
		super.updateScore(10);
	}
}